<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <!-- 新增频道查询 -->
      <el-form-item label="频道查询" prop="channelId">
        <el-select
          v-model="queryParams.channelId"
          placeholder="请选择频道"
          clearable
          filterable
          style="width: 200px"
          @change="handleQuery"
        >
          <el-option
            v-for="channel in channelList"
            :key="channel.id"
            :label="channel.channelName"
            :value="channel.id"
          />
        </el-select>
      </el-form-item>

      <el-form-item label="频道名称" prop="channelName">
        <el-input
          v-model="queryParams.channelName"
          placeholder="请输入频道名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <!-- 新增片名查询 -->
      <el-form-item label="片名查询" prop="play">
        <el-input
          v-model="queryParams.play"
          placeholder="请输入片名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <!-- 新增标题查询 -->
      <el-form-item label="标题查询" prop="defaultTitle">
        <el-input
          v-model="queryParams.defaultTitle"
          placeholder="请输入标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="状态" prop="state">
        <el-select v-model="queryParams.state" placeholder="请选择状态" clearable>
          <el-option
            v-for="dict in dict.type.upload_video"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="视频id" prop="videoId">
        <el-input
          v-model="queryParams.videoId"
          placeholder="请输入视频id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="版权" prop="copyRight">
        <el-input
          v-model="queryParams.copyRight"
          placeholder="请输入版权"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="类型" prop="type">
        <el-select v-model="queryParams.type" placeholder="请选择类型" clearable>
          <el-option
            v-for="dict in dict.type.sys_user_sex"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="关键字" prop="titleKey">
        <el-input
          v-model="queryParams.titleKey"
          placeholder="请输入标题关键字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="channelvideoList" @selection-change="handleSelectionChange" class="channelvideo-table">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="频道名称" align="center" prop="channelName"  width="180"/>

      <!-- 默认标题列优化 -->
      <el-table-column label="默认标题" align="center" width="400">
        <template slot-scope="scope">
          <div class="text-ellipsis-cell">
            <el-tooltip
              :content="scope.row.defaultTitle || '无标题'"
              placement="top-start"
              effect="light"
              :disabled="!scope.row.defaultTitle"
              popper-class="custom-tooltip"
            >
              <span class="cell-text">
                {{ formatCellContent(scope.row.defaultTitle, 60) }}
              </span>
            </el-tooltip>
          </div>
        </template>
      </el-table-column>

      <el-table-column label="状态" align="center" prop="state">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.upload_video" :value="scope.row.state"/>
        </template>
      </el-table-column>
      <el-table-column label="播放量" align="center" prop="viewCount" />
      <el-table-column label="发布时间" align="center" prop="publishTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="封面Url" align="center" prop="thumbnailUrl" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.thumbnailUrl" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="版权" align="center" prop="copyRight" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
        <template slot-scope="scope">
          <!-- 新增语言按钮 -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-global"
            @click="handleLanguage(scope.row)"
          >语言</el-button>
          <!-- 新增更新按钮 -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-refresh"
            @click="handleUpdateByVideoId(scope.row)"
          >更新</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改我频道下的视频对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="片名" prop="play">
          <el-input v-model="form.play" placeholder="请输入片名" />
        </el-form-item>
        <el-form-item label="默认标题" prop="defaultTitle">
          <el-input v-model="form.defaultTitle" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-select v-model="form.state" placeholder="请选择状态">
            <el-option
              v-for="dict in dict.type.upload_video"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="视频链接" prop="videoId">
          <el-input v-model="form.videoUrl" placeholder="请输入视频链接" />
        </el-form-item>
        <el-form-item label="版权" prop="copyRight">
          <el-input v-model="form.copyRight" placeholder="请输入版权" />
        </el-form-item>

        <!-- 关联频道id改为下拉框 -->
        <el-form-item label="关联频道" prop="channelId">
          <el-select
            v-model="form.channelId"
            placeholder="请选择关联频道"
            clearable
            filterable
            style="width: 100%"
            @change="handleChannelChange"
          >
            <el-option
              v-for="channel in channelFormList"
              :key="channel.id"
              :label="channel.channelName"
              :value="channel.id"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="操作表ID" prop="opId">
          <el-input v-model="form.opId" placeholder="请输入关联每日操作表主键ID" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 多语言编辑对话框 -->
    <el-dialog title="多语言编辑" :visible.sync="languageOpen" width="800px" append-to-body>
      <el-form ref="languageForm" :model="languageForm" :rules="languageRules" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="默认标题" prop="zhTw">
              <el-input v-model="languageForm.zhTw" placeholder="请输入默认标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="英语" prop="en">
              <el-input v-model="languageForm.en" placeholder="请输入英语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="阿拉伯语">
              <el-input v-model="languageForm.ar" placeholder="请输入阿拉伯语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="高棉语">
              <el-input v-model="languageForm.km" placeholder="请输入高棉语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="菲律宾语">
              <el-input v-model="languageForm.fil" placeholder="请输入菲律宾语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="法语">
              <el-input v-model="languageForm.fr" placeholder="请输入法语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="马来语">
              <el-input v-model="languageForm.ms" placeholder="请输入马来语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="泰米尔语">
              <el-input v-model="languageForm.ta" placeholder="请输入泰米尔语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="日语">
              <el-input v-model="languageForm.ja" placeholder="请输入日语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="韩语">
              <el-input v-model="languageForm.ko" placeholder="请输入韩语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="德语">
              <el-input v-model="languageForm.de" placeholder="请输入德语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="泰语">
              <el-input v-model="languageForm.th" placeholder="请输入泰语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="意大利语">
              <el-input v-model="languageForm.it" placeholder="请输入意大利语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="西班牙语">
              <el-input v-model="languageForm.es" placeholder="请输入西班牙语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="葡萄牙语">
              <el-input v-model="languageForm.pt" placeholder="请输入葡萄牙语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="越南语">
              <el-input v-model="languageForm.vi" placeholder="请输入越南语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="缅甸语">
              <el-input v-model="languageForm.my" placeholder="请输入缅甸语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="印地语">
              <el-input v-model="languageForm.hi" placeholder="请输入印地语标题" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="印度尼西亚语">
              <el-input v-model="languageForm.id" placeholder="请输入印度尼西亚语标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="俄语">
              <el-input v-model="languageForm.ru" placeholder="请输入俄语标题" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitLanguageForm">确 定</el-button>
        <el-button @click="cancelLanguage">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import { listChannelvideo, getChannelvideo, delChannelvideo, addChannelvideo, updateChannelvideo, updateByVideoId ,getChannelAllList, addSupportedLanguages} from "@/api/shortplay/channelvideo"

  export default {
    name: "Channelvideo",
    dicts: ['sys_user_sex', 'upload_video'],
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 我频道下的视频表格数据
        channelvideoList: [],
        // 频道列表数据（用于查询）
        channelList: [],
        // 频道列表数据（用于表单）
        channelFormList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 多语言编辑对话框显示状态
        languageOpen: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          channelName: null,
          defaultTitle: null,
          state: null,
          videoId: null,
          copyRight: null,
          videoUrl: null,
          type: null,
          titleKey: null,
          opId: null,
          // 新增查询参数
          channelId: null,
          play: null
        },
        // 表单参数
        form: {},
        // 多语言表单参数
        languageForm: {
          zhTw: '', // 默认标题
          en: '',   // 英语
          ar: '',   // 阿拉伯语
          km: '',   // 高棉语
          fil: '',  // 菲律宾语
          fr: '',   // 法语
          ms: '',   // 马来语
          ta: '',   // 泰米尔语
          ja: '',   // 日语
          ko: '',   // 韩语
          de: '',   // 德语
          th: '',   // 泰语
          it: '',   // 意大利语
          es: '',   // 西班牙语
          pt: '',   // 葡萄牙语
          vi: '',   // 越南语
          my: '',   // 缅甸语
          hi: '',   // 印地语
          id: '',   // 印度尼西亚语
          ru: ''    // 俄语
        },
        // 当前编辑的视频ID
        dataId: null,
        // 表单校验
        rules: {
          videoUrl: [
            { required: true, message: "视频链接不能为空", trigger: "blur" }
          ],
          channelId: [
            { required: true, message: "请选择关联频道", trigger: "change" }
          ],
        },
        // 多语言表单校验
        languageRules: {
          en: [
            { required: true, message: "英语标题不能为空", trigger: "blur" }
          ]
        }
      }
    },
    created() {
      this.getList()
      this.getChannelList()
    },
    methods: {
      /** 查询我频道下的视频列表 */
      getList() {
        this.loading = true
        listChannelvideo(this.queryParams).then(response => {
          this.channelvideoList = response.rows
          this.total = response.total
          this.loading = false
        }).catch(() => {
          this.loading = false
        })
      },

      /** 获取频道列表（用于查询和表单） */
      getChannelList() {
        getChannelAllList({ sourc: 'MY' }).then(response => {
          if (response.code === 200) {
            this.channelList = response.data || []
            this.channelFormList = response.data || []
          } else {
            this.$modal.msgError("获取频道列表失败")
            this.channelList = []
            this.channelFormList = []
          }
        }).catch(error => {
          console.error("获取频道列表失败:", error)
          this.$modal.msgError("获取频道列表失败")
          this.channelList = []
          this.channelFormList = []
        })
      },

      /** 格式化单元格内容 */
      formatCellContent(content, maxLength) {
        if (!content) return '-'
        if (content.length <= maxLength) return content
        return content.substring(0, maxLength) + '...'
      },

      /** 频道选择变化事件 */
      handleChannelChange(channelId) {
        if (channelId) {
          // 根据选中的频道ID找到对应的频道对象
          const selectedChannel = this.channelFormList.find(channel => channel.id === channelId)
          if (selectedChannel) {
            // 设置channelName字段的值
            this.form.channelName = selectedChannel.channelName
          }
        } else {
          // 清空选择时，清空channelName
          this.form.channelName = null
        }
      },

      /** 语言按钮操作 */
      handleLanguage(row) {
        this.currentVideoId = row.id
        // 初始化多语言表单数据
        this.languageForm = {
          zhTw: row.defaultTitle || '', // 默认标题
          en: '',   // 英语
          ar: '',   // 阿拉伯语
          km: '',   // 高棉语
          fil: '',  // 菲律宾语
          fr: '',   // 法语
          ms: '',   // 马来语
          ta: '',   // 泰米尔语
          ja: '',   // 日语
          ko: '',   // 韩语
          de: '',   // 德语
          th: '',   // 泰语
          it: '',   // 意大利语
          es: '',   // 西班牙语
          pt: '',   // 葡萄牙语
          vi: '',   // 越南语
          my: '',   // 缅甸语
          hi: '',   // 印地语
          id: '',   // 印度尼西亚语
          ru: ''    // 俄语
        }
        this.languageOpen = true
      },

      /** 提交多语言表单 */
      submitLanguageForm() {
        this.$refs["languageForm"].validate(valid => {
          if (valid) {
            // 准备提交数据
            const submitData = {
              dataId: this.currentVideoId,
              ...this.languageForm
            }

            addSupportedLanguages(submitData).then(response => {
              if (response.code === 200) {
                this.$modal.msgSuccess("保存成功")
                this.languageOpen = false
                this.getList() // 刷新列表
              } else {
                this.$modal.msgError(response.msg || "保存失败")
              }
            }).catch(error => {
              console.error("保存失败:", error)
              this.$modal.msgError("保存失败: " + (error.message || '未知错误'))
            })
          }
        })
      },

      /** 取消多语言编辑 */
      cancelLanguage() {
        this.languageOpen = false
        this.resetLanguageForm()
      },

      /** 重置多语言表单 */
      resetLanguageForm() {
        this.languageForm = {
          zhTw: '', // 默认标题
          en: '',   // 英语
          ar: '',   // 阿拉伯语
          km: '',   // 高棉语
          fil: '',  // 菲律宾语
          fr: '',   // 法语
          ms: '',   // 马来语
          ta: '',   // 泰米尔语
          ja: '',   // 日语
          ko: '',   // 韩语
          de: '',   // 德语
          th: '',   // 泰语
          it: '',   // 意大利语
          es: '',   // 西班牙语
          pt: '',   // 葡萄牙语
          vi: '',   // 越南语
          my: '',   // 缅甸语
          hi: '',   // 印地语
          id: '',   // 印度尼西亚语
          ru: ''    // 俄语
        }
        this.currentVideoId = null
        this.resetForm("languageForm")
      },

      /** 更新按钮操作 */
      handleUpdateByVideoId(row) {
        // 将ID包装在对象中传递
        const updateData = {
          id: row.id
        }

        this.$modal.confirm('是否确认更新视频ID为"' + row.id + '"的数据？').then(() => {
          return updateByVideoId(updateData)
        }).then(response => {
          if (response.code === 200) {
            this.$modal.msgSuccess("更新成功")
            this.getList() // 刷新列表
          } else {
            this.$modal.msgError(response.msg || "更新失败")
          }
        }).catch(error => {
          console.error("更新失败:", error)
          this.$modal.msgError("更新失败: " + (error.message || '未知错误'))
        })
      },

      // 取消按钮
      cancel() {
        this.open = false
        this.reset()
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          channelName: null,
          defaultTitle: null,
          state: null,
          videoId: null,
          viewCount: null,
          publishTime: null,
          thumbnailUrl: null,
          copyRight: null,
          remark: null,
          channelId: null,
          type: null,
          titleKey: null,
          createTime: null,
          createBy: null,
          updateBy: null,
          updateTime: null,
          opId: null,
          videoUrl: null,
          play:null
        }
        this.resetForm("form")
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1
        this.getList()
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm")
        // 重置频道选择
        this.queryParams.channelId = null
        this.queryParams.play = null
        this.queryParams.defaultTitle = null
        this.handleQuery()
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset()
        this.open = true
        this.title = "添加我频道下的视频"
        // 确保频道列表已加载
        if (this.channelFormList.length === 0) {
          this.getChannelList()
        }
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset()
        const id = row.id || this.ids
        getChannelvideo(id).then(response => {
          this.form = response.data
          this.open = true
          this.title = "修改我频道下的视频"
          // 确保频道列表已加载
          if (this.channelFormList.length === 0) {
            this.getChannelList()
          }
        })
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            // 处理表单数据，确保channelId是数字类型，并设置channelName
            const submitData = {
              ...this.form,
              channelId: this.form.channelId ? Number(this.form.channelId) : null
            }

            // 如果选择了频道，确保channelName有值
            if (this.form.channelId && !this.form.channelName) {
              const selectedChannel = this.channelFormList.find(channel => channel.id === this.form.channelId)
              if (selectedChannel) {
                submitData.channelName = selectedChannel.channelName
              }
            }

            if (this.form.id != null) {
              updateChannelvideo(submitData).then(response => {
                this.$modal.msgSuccess("修改成功")
                this.open = false
                this.getList()
              })
            } else {
              addChannelvideo(submitData).then(response => {
                this.$modal.msgSuccess("新增成功")
                this.open = false
                this.getList()
              })
            }
          }
        })
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids
        this.$modal.confirm('是否确认删除我频道下的视频编号为"' + ids + '"的数据项？').then(function() {
          return delChannelvideo(ids)
        }).then(() => {
          this.getList()
          this.$modal.msgSuccess("删除成功")
        }).catch(() => {})
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('shortplay/channelvideo/export', {
          ...this.queryParams
        }, `channelvideo_${new Date().getTime()}.xlsx`)
      }
    }
  }
</script>

<style scoped>
  .app-container {
    padding: 20px;
  }

  /* 表格单元格文本省略样式 */
  .channelvideo-table ::v-deep .text-ellipsis-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
  }

  .channelvideo-table ::v-deep .cell-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.4;
    cursor: pointer;
    pointer-events: auto;
    padding: 4px 0;
    font-size: 13px;
  }

  /* 确保tooltip包装器正确 */
  .channelvideo-table ::v-deep .el-tooltip {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* 鼠标悬浮效果增强 */
  .channelvideo-table ::v-deep .text-ellipsis-cell:hover .cell-text {
    background-color: #f5f7fa;
    border-radius: 4px;
    color: #409eff;
  }

  /* 表格样式优化 */
  .channelvideo-table ::v-deep .el-table__body-wrapper .el-table__body td {
    padding: 6px 0;
  }

  .channelvideo-table ::v-deep .el-table .cell {
    line-height: 1.4 !important;
    padding: 6px 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .channelvideo-table ::v-deep .el-table__row {
    height: 42px !important;
  }

  .channelvideo-table ::v-deep .el-table__row td {
    height: 42px !important;
    max-height: 42px !important;
  }

  .channelvideo-table ::v-deep .el-table--medium .el-table__cell {
    padding: 6px 0 !important;
  }

  /* 标题列特殊样式 */
  .channelvideo-table ::v-deep .el-table__row td:nth-child(3) .cell-text {
    color: #606266;
    font-weight: 500;
  }
</style>

<style>
  /* 增强的tooltip样式 */
  .custom-tooltip {
    max-width: 600px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    word-break: break-all !important;
    word-wrap: break-word !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    background-color: #fff !important;
    border: 1px solid #e4e7ed !important;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) !important;
    color: #606266 !important;
    z-index: 9999 !important;
  }

  .custom-tooltip[x-placement^="top"] .popper__arrow {
    border-top-color: #e4e7ed !important;
  }

  .custom-tooltip[x-placement^="top"] .popper__arrow::after {
    border-top-color: #fff !important;
  }
</style>
